package cn.gson.work.model.pojos;

import javax.persistence.*;
import java.util.Collection;
import java.util.Objects;

@Entity
public class Budcate {
    private long bcId;
    private Long bId;
    private String bcName;
    private Collection<Budget> budgets;

    @Id
    @Column(name = "BC_ID")
    public long getBcId() {
        return bcId;
    }

    public void setBcId(long bcId) {
        this.bcId = bcId;
    }

    @Basic
    @Column(name = "B_ID")
    public Long getbId() {
        return bId;
    }

    public void setbId(Long bId) {
        this.bId = bId;
    }

    @Basic
    @Column(name = "BC_NAME")
    public String getBcName() {
        return bcName;
    }

    public void setBcName(String bcName) {
        this.bcName = bcName;
    }

    @OneToMany(mappedBy = "budcate")
    public Collection<Budget> getBudgets() {
        return budgets;
    }

    public void setBudgets(Collection<Budget> budgets) {
        this.budgets = budgets;
    }



    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Budcate budcate = (Budcate) o;
        return bcId == budcate.bcId &&
                Objects.equals(bId, budcate.bId) &&
                Objects.equals(bcName, budcate.bcName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(bcId, bId, bcName);
    }
}
